import React, { Component } from "react";

export default class Video extends Component {
  render() {
    //获取 props 中的数据
    let {img, title, author, isLiving} = this.props;
    return (
      <div  className="video-item">
        <img src={img} alt="" />
        <p className="title">
          {/* 对直播中的图片进行条件渲染 */}
          {isLiving && <span className='live'>
            <img alt="" className='gif' src="https://s1.hdslb.com/bfs/static/jinkela/long/images/live.gif" />直播中
          </span>}
          
          {title}</p>
        <p className="up">{author}</p>
      </div>
    );
  }
}
